package com.atguigu.mytest.common.utils;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.Map;

public class Query<T> {
    public IPage<T> getPage(Map<String, Object> params) {
        long current = 1L;
        long size = 10L;
        if (params.get("page") != null) {
            current =  Long.parseLong((String) params.get("page"));
        }
        if (params.get("pageSize") != null) {
            size =  Long.parseLong((String) params.get("pageSize"));
        }
        return new Page<>(current, size);
    }
}
